#ifndef __TOUCH_CPP__
#define __TOUCH_CPP__

#include "lcd.hpp"
#include "toolbar.hpp"

class Touch
{
public:
    Touch(LCD &lcd_ref, Toolbar &toolbar_ref);
    ~Touch();
    void touch_init();
    void detect_init(); // 开始监听触摸屏事件
    void touch_handle();
    void touch_release();
    void draw();

private:
    FILE *fp_touch;
    LCD &lcd;
    Toolbar &toolbar;
    int x, y;
    int last_x, last_y;
    int is_touching; // 0:没有触摸 1:触摸
    int color;
    int radius;
};

#endif